package com.kwt.learn.hashcode;

import java.util.HashMap;

public class HashCode02 {
    public static void main(String[] args) {
        put();
    }

    /**
     * 引用类型作为key，存入hashmap
     */
    public static void put() {
        HashMap<Student, Integer> studentIntegerHashMap = new HashMap<>();
        Student kwt = new Student("kwt", 12);
        Student kwtt = kwt;
        System.out.println(kwt.equals(kwtt));
        studentIntegerHashMap.put(kwt, 23);
        System.out.println(kwt.hashCode());
        System.out.println(studentIntegerHashMap.get(kwt));

    }
}
